fix: improve logging in task execution#44
Open
alvarobernal2412 wants to merge 2 commits into
Open
Conversation
This was
linked to
issues
Jul 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces several enhancements and fixes across multiple files, focusing on improving error handling, logging, task management, and testing. Key changes include more robust error handling, detailed logging for debugging, atomic task updates, and refined test assertions.
Error Handling Improvements:
controllers/apiv1tasksidControllerService.js: Enhanced theupdateTaskmethod to validate task IDs and properties, and added comprehensive error handling for server-side issues.controllers/apiv1taskstestControllerService.js: Improved error responses inrunTaskTestby providing detailed error messages for invalid scripts.controllers/filemanager/index.js: UpdateddeleteTaskFileto handle errors during file deletion and throw a descriptive error if the task file is not found.Logging Enhancements:
controllers/taskExecutor/index.js: Added detailed logging for task execution and script handling, including success and error messages for debugging purposes. [1] [2]controllers/utils/index.js: Improved logging ingetTasksByDatato highlight mismatched properties during task filtering.Task Management Improvements:
controllers/filemanager/index.js: RefinedupdateTaskto ensure atomic updates by writing new files first and removing outdated files only after successful writes.Testing Adjustments:
tests/test.js: Modified test assertions to useassert.notStrictEqualinstead ofassert.strictEqualfor verifying API responses, ensuring better validation of response differences. [1] [2]Configuration Updates:
.env.example: Added new environment variablesOASTLM_MODULE_DISABLEDandGOV_LOG_LEVELfor module control and logging configuration.